#!/usr/bin/perl

use Bio::DB::EUtilities;
 
my @accs    = qw(CAB02640 EAS10332 YP_250808 NP_623143 P41007);

my $factory = Bio::DB::EUtilities->new(-eutil => 'esearch',
                                       -db    => 'protein',
                                       -term  => join(',',@accs) );
  
my @uids    = $factory->get_ids;
    
$factory->reset_parameters(-eutil => 'esummary',
                           -db    => 'protein',
                           -id    => \@uids);
     
while (my $ds = $factory->next_DocSum) {
  print "ID: ",$ds->get_id,"\n";
  # flattened mode
  while (my $item = $ds->next_Item('flattened'))  {
    # not all Items have content, so need to check...
    printf("%-20s:%s\n",$item->get_name,$item->get_content) if $item->get_content;
  }
  print "\n";
}
